package com.ldc.security.service;

import com.ldc.security.utils.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * 获取用户服务
 *
 * @auther liudc
 * @since 2022/11/5
 */
@Service
public class CustomUserDetailsService implements UserDetailsService {
    @Autowired
    private SecurityUtils securityUtils;


    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return securityUtils.loadUserByUsername(username);
    }


}
